/******************************************************************************
* Copyright (C) 2020 ShenZhen Powerdata Information Technology Co.,Ltd
* All Rights Reserved.
* 本软件为***研制。未经本公司正式书面同意，其他任何个人、团体不得使用、
* 复制、修改或发布本软件.
*****************************************************************************/

package com.xxl.job.listener.mq.entity;

import org.apache.rocketmq.client.exception.MQBrokerException;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.remoting.exception.RemotingException;

/**
* @Title:
* @ClassName:  A   
* @Description:TODO  
* @author: xgf
* @date:   2020年2月22日 下午2:57:00   
* @since   JDK1.8
* @history 2020年2月22日 TODO 新建
*/
public class A {

	public static void main(String[] args) throws MQClientException, RemotingException, MQBrokerException, InterruptedException {
		DefaultMQProducer producer = new DefaultMQProducer("test_quick_producer_name");
		producer.setNamesrvAddr("172.16.11.12:9876");
		producer.start();
		for (int i = 0; i < 5; i++) {
			Message message = new Message("test_quick_topic", "tagA","key" + i, ("Hello Rocket" + i).getBytes());
			SendResult send = producer.send(message,10000);
			System.out.println("消息发出 ： " + send);
		}
		producer.shutdown();
		
	}
}
